<?php include("../Service/WebClass/admin/IndustryClass.php");
$industry = new Industry;
$industry->MyTask();
?>


	 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->	
<title>企業属性別集計分析</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script language="JavaScript" src="../js/common.js" type="text/javascript"></script>
<script language="JavaScript" src="../js/Calendar4.js" type="text/javascript"></script>
<script>
function do_csv()
{
	document.getElementById("act").value = "csv";
	document.getElementById("mainform").submit();	
}
function do_search()
{
    if(document.getElementById("search_detail").style.display != "none")
	{
        if(checkFilter() == false)
		{
			alert("整数値を入力してください。");
			return false;
		}		
	}    
    document.getElementById("act").value = "submit";
	// 詳細検索状態をセットする
	if(document.getElementById("search_detail").style.display == "none")
	{
		// 詳細検索は非表示の場合
		document.getElementById("search_detail_hid").value = "display:none";
	}
	else
	{
		// 詳細検索は表示の場合
		document.getElementById("search_detail_hid").value = null;
	}
    document.getElementById("mainform").submit();	
	
}

function checkFilter()
{
	var regexs = /^[1-9]+[0-9]*$/;
	if(document.getElementById("filter_value").value != "" && document.getElementById("filter_value").value != "")
	{
        var result1 = regexs.test(document.getElementById("filter_value").value);
		if(result1 == false)
		{
			return false;
		}		
	}
	if(document.getElementById("filter3_value").value != "" && document.getElementById("filter3_value").value != "")
	{
		var result3 = regexs.test(document.getElementById("filter3_value").value);
		if(result3 == false)
		{
			return false;
		}
	}
	return true;
}
</script>

</head>
<body bgcolor="#F4FFE4">
<?php include("../head.php");?>
 
<table width="100%" border="0" cellspacing="0" cellpadding="0">

 <tr>
    <td width="165" valign="top" bgcolor="#5C743D">
    <?php include("../adminMenu.php");?>
<form method="post" id="mainform" name="mainform">
<input type=hidden id="nowPage" name="nowPage" value="1">
<input type=hidden name=search_detail_hid id=search_detail_hid>		
<?php
echo "<input type=hidden id=act name=act value=submit>"
?>		    	
<div class="sidemenu1">表示形式</div>
<div class="sidemenu4">
	<input name="report_axis" id="axis_id" value="id" onclick="javascript:document.getElementById('nowPage').value = 1;do_search();" type="radio"><label for="axis_id">企業属性別</label><br>
	<input name="report_axis" id="axis_d" value="d" onclick="javascript:document.getElementById('nowPage').value = 1;do_search();" type="radio"><label for="axis_d">日別</label><br>	
	<input name="report_axis" id="axis_w" value="w" onclick="javascript:document.getElementById('nowPage').value = 1;do_search();" type="radio"><label for="axis_w">週別</label><br>
	<input name="report_axis" id="axis_dow" value="dow" onclick="javascript:document.getElementById('nowPage').value = 1;do_search();" type="radio"><label for="axis_dow">曜日別</label><br>
	<input name="report_axis" id="axis_m" value="m" onclick="javascript:document.getElementById('nowPage').value = 1;do_search();" type="radio"><label for="axis_m">月別</label><br>
	<script>
	var list = document.getElementsByName("report_axis");
	var i;
	for(i=0;i<list.length;i++)
	{
		if(list[i].value == "<?php echo $industry->reportAxis;?>")
		{
			list[i].checked = true;
			break;
		}
	}
	</script>
</div>
    </td>
    <td width="813" colspan="2" align="center" valign="top">    
      <!-- search_area start -->
<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tbl where">
	<tr>
		<td>

<input type="text" name="from_date" id="cal_input_from" value="<?php echo $industry->fromDate;?>" class="txBox" style="width: 65px;">
<a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(getObjById('cal_input_from'));return false;" HIDEFOCUS>
<img name="popcal2" align="top" src="../images/cal.gif" border="0" alt="calendar" onclick="MyCalendar.SetDate(this,document.getElementById('cal_input_from'))"></a>
-
<input type="text" name="to_date" id="cal_input_to" value="<?php echo $industry->toDate;?>" class="txBox" style="width: 65px;">
<a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(getObjById('cal_input_to'));return false;" HIDEFOCUS>
<img name="popcal2" align="top" src="../images/cal.gif" border="0" alt="calendar" onclick="MyCalendar.SetDate(this,document.getElementById('cal_input_to'))"></a>
&nbsp;&nbsp;
<input type="button" class="btn search" value="" onclick="javascript:document.getElementById('nowPage').value = 1;do_search();">
&nbsp;&nbsp;
<input type="button" class="btn btn_wider" value="▼詳細検索..." onclick="openCloseSearchDetail()">	
</td>
</tr>
	<tr id="search_detail" style="<?php echo $industry->searchDetailHid?>">
		<td>業種<select name="search_col_industry" id="search_col_industry" class="txBox">
	<option value=0>指定なし</option>
    <?php echo $industry->industryOptionList?>
</select>
<script>document.getElementById("search_col_industry").value = "<?php echo $industry->search_col_industry;?>";</script>&nbsp;&nbsp;&nbsp;&nbsp;		
企業規模<select name="search_col_scale" id="search_col_scale" class="txBox">
	<option value=0>指定なし</option>
	<?php echo $industry->scaleOptionList?>
	<script>document.getElementById("search_col_scale").value = "<?php echo $industry->search_col_scale;?>";</script>
</select>		
<br>	
<select name="filter_col" id="filter_col" class="txBox">
<option value="impression" >Imp
<option value="clickCnt" >Click
<option value="ctr" >CTR[%]
<option value="cpc" >CPC[円]
<option value="cost" >コスト[円]
<option value="cv" >CV
<option value="cvr" >CVR[%]
<option value="cpa" >CPA[円]
<option value="cpm" >CPM[円]
<option value="roas" >ROAS[円]
<option value="sales" >売上[円]
<option value="salesValue" >売上単価[円]
<option value="directCvCnt" >直接
<option value="indirectCvCnt" >間接
<option value="asistCvCnt" >アシスト
<option value="postCvCnt" >ポスト効果
</select>
<script>document.getElementById("filter_col").value = "<?php echo $industry->filterCol;?>";</script>	
<input type="text" name="filter_value" id="filter_value" size="10" maxlength="10" value="<?php echo $industry->filterValue;?>" class="txBox">
<select name="filter_type" id="filter_type" class="txBox">
	<option value="1" >以上
	<option value="2" >以下
</select>
<script>document.getElementById("filter_type").value = "<?php echo $industry->filterType;?>";</script>	
&nbsp;&nbsp;
<select name="filter3_col" id="filter3_col" class="txBox">
<option value="impression" >Imp
<option value="clickCnt" >Click
<option value="ctr" >CTR[%]
<option value="cpc" >CPC[円]
<option value="cost" >コスト[円]
<option value="cv" >CV
<option value="cvr" >CVR[%]
<option value="cpa" >CPA[円]
<option value="cpm" >CPM[円]
<option value="roas" >ROAS[円]
<option value="sales" >売上[円]
<option value="salesValue" >売上単価[円]
<option value="directCvCnt" >直接
<option value="indirectCvCnt" >間接
<option value="asistCvCnt" >アシスト
<option value="postCvCnt" >ポスト効果
</select>
<script>document.getElementById("filter3_col").value = "<?php echo $industry->filter3Col;?>";</script>	
<input type="text" name="filter3_value" id="filter3_value" size="10" maxlength="10" value="<?php echo $industry->filter3Value;?>" class="txBox">
<select name="filter3_type" id="filter3_type" class="txBox">
	<option value="1" >以上
	<option value="2" >以下
</select>
<script>document.getElementById("filter3_type").value = "<?php echo $industry->filter3Type;?>";</script>	
&nbsp;&nbsp;
		</td>
	</tr>
</table>
<!-- search_area end -->

<img src="../images/spacer.gif" width="1" height="5" border="0"><br>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tbl_clear">
	<tr height="30" valign="bottom">

		<td align="left">
			<img src="../images/ico_graph_line.gif" border="0">
			指標1
			<select name="graph_col1" id="graph_col1" size="1" class="txBox" onchange="do_search();">
				<option value="impression" >Imp
				<option value="clickCnt">Click
				<option value="ctr" >CTR[%]
				<option value="cpc" >CPC[円]
				<option value="cost" >コスト[円]
				<option value="cv" >CV
				<option value="cvr" >CVR[%]
				<option value="cpa" >CPA[円]
				<option value="cpm" >CPM[円]
				<option value="roas" >ROAS[円]
				<option value="sales" >売上[円]
				<option value="salesValue" >売上単価[円]
				<option value="clickCvSpan" >Click-CV間隔[秒]
				<option value="directCvCnt" >直接
				<option value="indirectCvCnt" >間接
				<option value="asistCvCnt" >アシスト
				<option value="postCvCnt" >ポスト効果
				</select>
			<script>document.getElementById("graph_col1").value = "<?php echo $industry->graphCol1;?>"</script>		
			&nbsp;
			指標2
			<select name="graph_col2" id="graph_col2" size="1" class="txBox" onchange="do_search();">
				<option value="impression" >Imp
				<option value="clickCnt" >Click
				<option value="ctr" >CTR[%]
				<option value="cpc" >CPC[円]
				<option value="cost" >コスト[円]
				<option value="cv">CV
				<option value="cvr" >CVR[%]
				<option value="cpa" >CPA[円]
				<option value="cpm" >CPM[円]
				<option value="roas" >ROAS[円]
				<option value="sales" >売上[円]
				<option value="salesValue" >売上単価[円]
				<option value="clickCvSpan" >Click-CV間隔[秒]
				<option value="directCvCnt" >直接
				<option value="indirectCvCnt" >間接
				<option value="asistCvCnt" >アシスト
				<option value="postCvCnt" >ポスト効果
			</select>
			<script>document.getElementById("graph_col2").value = "<?php echo $industry->graphCol2;?>"</script>
						&nbsp;&nbsp;
			グラフサイズ
			<select name="graph_size" id="graph_size" size="1" class="txBox" onchange="do_search();">
				<option value="0" selected>標準
				<option value="1" >最大
				<option value="2" >非表示
			</select>
			<script>document.getElementById("graph_size").value = "<?php echo $industry->graphSize;?>"</script>							
		</td>
		<td align="right">
		<input type="button" class="btn_exp csv" title="CSV出力" value="" onclick="do_csv()"></td>
	</tr>
</table>
<div id="chart_area">
<?php
	// 初期化の場合、図は表示しない
	if($industry->graphSize == "2")
	{
	}
	else
	{
		$src = "../Service/Graph/admin/IndustryGraph.php?reportAxis=".$industry->reportAxis."&fromDate=".$industry->fromDate;
		$src = $src."&toDate=".$industry->toDate."&searchDetail=".$industry->searchDetailHid;
		$src = $src."&searchColIndustry=".$industry->search_col_industry."&searchColScale=".$industry->search_col_scale;
		$src = $src."&filterCol=".$industry->filterCol."&filterValue=".$industry->filterValue."&filterType=".$industry->filterType;
		$src = $src."&filter3Col=".$industry->filter3Col."&filter3Value=".$industry->filter3Value."&filter3Type=".$industry->filter3Type;
		$src = $src."&graphType=1";
		$src = $src."&graphCol1=".$industry->graphCol1."&graphCol2=".$industry->graphCol2."&graphSize=".$industry->graphSize;
		$src = $src."&nowPageNum=".$industry->nowPageNum;
		//echo $src;
		echo "<img id=graph src=".$src.">";
	}
?>
</div>
<br>
<table width="100%" border="0" cellpadding="2" cellspacing="0">
	<tr>

		<td align="left">
			<img src="../images/ico_summary.gif" border="0">
ビュー
<select name="select_view" id="select_view" size="1" class="txBox" onchange="javascript:document.getElementById('nowPage').value = 1;do_search();">
	<option value="1" selected>標準ビュー
	<option value="2" >コスト分析
	<option value="4" >コンバージョン
	</select>
<script>document.getElementById("select_view").value = "<?php echo $industry->selectView;?>"</script>				
	</td>
		<td align="right">
			<input type="button" class="btn refresh" onclick="do_search();"></td>

	</tr>
</table>

<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tbl">
<tr align="right" class="tr2">
<?php echo $industry->tableList;?>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr align="right"> 
<td align="right">
<?php echo "<label id='fromToPage' name='fromToPage'>".$industry->fromToRowHtml."</label>";?>     
<?php echo "<label id='memberInfoCount' name='memberInfoCount'>".$industry->allRowHtml."</label>";?>
</td><td>
<?php echo $industry->pageLinkHtml;?>
</td>  
</tr>
</table>
<br>

</form>

<div id="input_area">
</div>			<!-- end of main area -->
    <br />
    <br />
    </td>

  </tr>
 </table>
<?php
include("../foot.php");
?>
</body>
</html>
